package zlatan_demo16_option

object ClassDemo02 {
  def main(args: Array[String]): Unit = {
    //定义偏函数，根据给定的整数返回其对应的字符串

    val pf:PartialFunction[Int,String]={
      case 1=>"一"
      case 2=>"二"
      case 3=>"三"
      case _=>"其他"

    }
    println(pf(1))
    println(pf(2))
    println(pf(3))
    println(pf(44))
  }

}
